<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>事件访问修饰符</title>
	</head>
	<body>
		<div id="app">
			<div>
				数字a<input type="text" name="num1" v-model="num1"/> </div>
			<div>
				数字b<input type="text" name="num2" v-model="num2" @keyup.enter="addNum"/> </div>
			<button type="button" @click="addNum">计算</button><br />
			计算结果:<span v-text="count"></span>
		</div>
		<script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
		<script type="text/javascript">
			const app = new Vue({
				el: '#app',
				data: {
					num1: '',
					num2: '',
					count: ''

				},
				methods: {
					addNum() {
						this.count = parseInt(this.num1) + parseInt(this.num2)
					}
				}
			})
		</script>
	</body>
</html>
